--
-- Author: gnar
-- Date: 2016-01-01 09:57:11
--

local Tips = {}

function Tips.ShowTTF(args)

    str = args.str
    parent = args.parent or cc.Director:getInstance():getRunningScene()
    pos = args.pos or {x = display.width * 0.5, y = display.height * 0.7} 
    color = args.color or Constants.color1
    size = args.size or 40
    --local label = cc.Label:createWithTTF(str, Constants.selfFont1, size)
    --label:setTextColor(color)
    local label = cc.LabelTTF:create(str, Constants.font1, size)
    label:setFontFillColor(color)
    label:align(cc.p(0.5, 0.5), pos.x, pos.y)
        :addTo(parent)

    local actions = {}
    actions[#actions + 1] = cc.FadeOut:create(3)
    actions[#actions + 1] = cc.CallFunc:create(function() label:removeFromParent() end)
    local seq = transition.sequence(actions)
    label:runAction(seq)

end



return Tips